package com.longrise.android.upload_offline;

import com.longrise.android.byjk.common.DownloadConstants;
import com.longrise.android.upload_offline.synchron.VideoDB;

/**
 * Created by sujizhong on 16/3/2.
 */
public class DBSQL {

    /**
     * 插入数据库表
     */
    public static final String INSERT = "insert into " + VideoDB.TABLE_NAME + "(" + VideoDB.EXOIRETIME + "," + VideoDB.ID + "," + VideoDB.STUDENTNO + "," + VideoDB.EFFECTTIME + ")values(?,?,?,?)";

    /**
     * 根据条件删除数据
     */
    public static final String DELETE = "delete from " + VideoDB.TABLE_NAME + " where " + VideoDB.STUDENTNO + "=?";

    /**
     * 清空表数据
     */
    public static final String DELETE_ALL = "delete from " + VideoDB.TABLE_NAME;

    /**
     * 查询数据库表
     */
    public static final String QUERY = "select * from " + VideoDB.TABLE_NAME;

    //默认查询前十条
    public static final String QUERY_LIMIT = "select * from " + VideoDB.TABLE_NAME + " limit 10";

    /**
     * 查询ID 根据条件查询
     */
    public static final String ID_QUERY = "select " + VideoDB.ID + " from " + VideoDB.TABLE_NAME + " where " + VideoDB.ID + "=?";

    /**
     * 查询前多少条记录
     */
    public static final String QUERY_TOP = "select top ? * from " + VideoDB.TABLE_NAME;


    /**
     * 创建断点播放表
     */
    public static final String CREATE_OFFLINE_PLAY = "";

    /**
     * query local video
     */
    public static final String QUERY_STUDY_INFOR = "select * from " + DownloadConstants.TBNAME_DOWNLOAD_DETAIL + " where (" + DownloadConstants.USERID + " = ?," + "'" + DownloadConstants.COURSEID + "'" + " = ?," + DownloadConstants.CWID + " = ?)values(?,?,?)";


    public static final String QUERY_QUERY_CACHEPATH = "select * from " + DownloadConstants.TBNAME_DOWNLOAD_DETAIL +
            " where userID = ? and courseID = ? and " + DownloadConstants.CWID + " = ? order by position asc ";

}
